package com.qyzmt.service.impl;

import com.qyzmt.mapper.VolunteerMapper;
import com.qyzmt.pojo.Volunteer;
import com.qyzmt.service.VolunteerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;


@Service
public class VolunteerServiceImpl implements VolunteerService {

    @Autowired
    private VolunteerMapper volunteerMapper;
    // 列出全部志愿者
    @Override
    public List<Volunteer> list() {
        return volunteerMapper.list();
    }

    // 新增志愿者
    @Override
    public void add(Volunteer volunteer) {
        volunteer.setRegister_date(LocalDate.now());
        volunteerMapper.add(volunteer);
    }
}
